"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
  data() {
    return {
      title: "Hello",
      // 轮播图数据
      pictures: [
        { id: "1", url: "https://pcapi-xiaotuxian-front-devtest.itheima.net/miniapp/uploads/goods_preview_1.jpg" },
        { id: "2", url: "https://pcapi-xiaotuxian-front-devtest.itheima.net/miniapp/uploads/goods_preview_2.jpg" },
        { id: "3", url: "https://pcapi-xiaotuxian-front-devtest.itheima.net/miniapp/uploads/goods_preview_3.jpg" },
        { id: "4", url: "https://pcapi-xiaotuxian-front-devtest.itheima.net/miniapp/uploads/goods_preview_4.jpg" },
        { id: "5", url: "https://pcapi-xiaotuxian-front-devtest.itheima.net/miniapp/uploads/goods_preview_5.jpg" }
      ],
      items: [
        { icon: "/static/grid/invite.png", text: "邀请伙伴" },
        { icon: "/static/grid/partner.png", text: "伙伴情况" },
        { icon: "/static/grid/record.png", text: "答题记录" },
        { icon: "/static/grid/answer.png", text: "参与答题" },
        { icon: "/static/grid/ranking.png", text: "排行榜" },
        { icon: "/static/grid/editname.png", text: "修改资料" },
        { icon: "/static/grid/feedback.png", text: "意见反馈" },
        { icon: "/static/grid/game.png", text: "罗盘游戏" },
        { icon: "/static/grid/team.png", text: "大团队长" }
        // Add more items as needed
      ]
    };
  },
  onLoad() {
  },
  methods: {
    onPreviewImage(url) {
      common_vendor.index.previewImage({
        urls: this.pictures.map((v) => v.url),
        current: url
      });
    },
    handleItemClick(item) {
      if (item.text === "答题记录") {
        common_vendor.index.navigateTo({
          url: "index/studyrecord/studyrecord"
        });
      } else if (item.text === "参与答题") {
        common_vendor.index.navigateTo({
          url: "index/studylist/studylist"
        });
      } else if (item.text === "排行榜") {
        common_vendor.index.navigateTo({
          url: "index/studyrank/studyrank"
        });
      }
    }
  }
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return {
    a: common_vendor.f($data.pictures, (item, k0, i0) => {
      return {
        a: common_vendor.o(($event) => $options.onPreviewImage(item.url), item.id),
        b: item.url,
        c: item.id
      };
    }),
    b: common_vendor.t($data.title),
    c: common_vendor.f($data.items, (item, index, i0) => {
      return {
        a: item.icon,
        b: common_vendor.t(item.text),
        c: index,
        d: common_vendor.o(($event) => $options.handleItemClick(item), index)
      };
    })
  };
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
